<div class="form">
<?php /** @var BootActiveForm $form */
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id'=>'horizontalForm',
    'type'=>'horizontal',
	'htmlOptions'=>array('enctype' => 'multipart/form-data'),
)); ?>

     	<fieldset>
		<legend>
			<span class="required">*</span> Wajib Diisi.
		</legend>

	<?php echo $form->errorSummary($model,'Opps!!!', null,array('class'=>'alert alert-error span12')); ?>
        		
   <div class="control-group">		
			<div class="span10">

	<?php
	$superUser = User::model()->findByPk(Yii::app()->user->getId())->superuser;
	$bidang = User::model()->findByPk(Yii::app()->user->getId())->id_bidang;
	?>			
	 <?php 
	 if($superUser==1){
	 echo $form->DropDownListRow($model,'id_bidang',CHtml::listData(Bidang::model()->findAll(), 'id', 'nama_bidang' ),array('prompt'=>'Pilih Bidang',
          'value'=>'0',
          'id'=>'bidang_id',
          )); 
	}
	else{
	?>

	<div class="control-group ">
	<label class="control-label" for="Tugaswewenang_id_bidang">Nama Bidang</label>
	<div class="controls">
	<input id="Tugaswewenang_id_bidang" class="span2" type="text" name="id_bidang" value="<?= Bidang::model()->findByPk($bidang)->nama_bidang ?>" readonly="readonly" maxlength="100">
	</div>
	</div>
	<?php
	echo $form->hiddenField($model,'id_bidang',array('class'=>'span2','maxlength'=>100,'value'=>$bidang));
	}
    ?>


	<div class="row">
	<div class="control-group ">
	<label class="control-label required" for="Post_detail">
	Detail Tugas dan Wewenang
	<span class="required">*</span>
	</label>
	<div class="controls">
				<?php $this->widget('application.extensions.CKEditor', array(
			'model'=>$model,
			'attribute'=>'detail',
			'language'=>'en',
			'editorTemplate'=>'full',
)); ?>
	</div>
	</div>
	<?php echo $form->error($model,'isi'); ?>
	</div>


                       </div>   
  </div>

	<div class="form-actions" style="text-align:center">
		<?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType'=>'submit',
			'type'=>'primary',
                        'icon'=>'ok white',  
			'label'=>$model->isNewRecord ? 'Tambah' : 'Simpan',
		)); ?>
              <?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType'=>'reset',
                        'icon'=>'remove',  
			'label'=>'Reset',
		)); ?>
	</div>
</fieldset>

<?php $this->endWidget(); ?>

</div>
